<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.4"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Flow: flow::log::Component Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Flow<span id="projectnumber">&#160;2.0.0</span>
   </div>
   <div id="projectbrief">Flow project: Public API.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespaceflow.html">flow</a></li><li class="navelem"><a class="el" href="namespaceflow_1_1log.html">log</a></li><li class="navelem"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classflow_1_1log_1_1Component-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">flow::log::Component Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>A light-weight class, each object storing a <em>component</em> payload encoding an <code>enum</code> value from <code>enum</code> type of user's choice, and a light-weight ID of that <code>enum</code> type itself.  
 <a href="classflow_1_1log_1_1Component.html#details">More...</a></p>

<p><code>#include &lt;log.hpp&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-types" name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a287888e2943b312f4febc3e8e130fc80"><td class="memItemLeft" align="right" valign="top"><a id="a287888e2943b312f4febc3e8e130fc80" name="a287888e2943b312f4febc3e8e130fc80"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>enum_raw_t</b> = unsigned int</td></tr>
<tr class="memdesc:a287888e2943b312f4febc3e8e130fc80"><td class="mdescLeft">&#160;</td><td class="mdescRight">The type <code>Payload</code> must be <code>enum class Payload : enum_raw_t</code>: an <code>enum</code> type encoded via this integer type. <br /></td></tr>
<tr class="separator:a287888e2943b312f4febc3e8e130fc80"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8c746035d0eea4a26d0982eabf63b713"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a8c746035d0eea4a26d0982eabf63b713">Component</a> ()</td></tr>
<tr class="memdesc:a8c746035d0eea4a26d0982eabf63b713"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> that stores no payload; meaning an unspecified-component <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> that returns <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>.  <a href="classflow_1_1log_1_1Component.html#a8c746035d0eea4a26d0982eabf63b713">More...</a><br /></td></tr>
<tr class="separator:a8c746035d0eea4a26d0982eabf63b713"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2dbca7a7e6b6c43c2119db1858c3b29d"><td class="memTemplParams" colspan="2">template&lt;typename Payload &gt; </td></tr>
<tr class="memitem:a2dbca7a7e6b6c43c2119db1858c3b29d"><td class="memTemplItemLeft" align="right" valign="top">&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a2dbca7a7e6b6c43c2119db1858c3b29d">Component</a> (Payload <a class="el" href="classflow_1_1log_1_1Component.html#a656f5868adbd8c58c493981fe1764699">payload</a>)</td></tr>
<tr class="memdesc:a2dbca7a7e6b6c43c2119db1858c3b29d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> with the given payload of arbitrary type, so long as that type is an <code>enum class : <a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80" title="The type Payload must be enum class Payload : enum_raw_t: an enum type encoded via this integer type.">Component::enum_raw_t</a></code>.  <a href="classflow_1_1log_1_1Component.html#a2dbca7a7e6b6c43c2119db1858c3b29d">More...</a><br /></td></tr>
<tr class="separator:a2dbca7a7e6b6c43c2119db1858c3b29d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5edb4c020c9de20e4c1c96c460b624e8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a5edb4c020c9de20e4c1c96c460b624e8">Component</a> (const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;src)</td></tr>
<tr class="memdesc:a5edb4c020c9de20e4c1c96c460b624e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copies the source <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> into <code>*this</code>.  <a href="classflow_1_1log_1_1Component.html#a5edb4c020c9de20e4c1c96c460b624e8">More...</a><br /></td></tr>
<tr class="separator:a5edb4c020c9de20e4c1c96c460b624e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a325e56b14d7ce51ea4ee3cdfe6189490"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a325e56b14d7ce51ea4ee3cdfe6189490">Component</a> (<a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&amp;src_moved)</td></tr>
<tr class="memdesc:a325e56b14d7ce51ea4ee3cdfe6189490"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs <code>*this</code> equal to <code>src_moved</code>.  <a href="classflow_1_1log_1_1Component.html#a325e56b14d7ce51ea4ee3cdfe6189490">More...</a><br /></td></tr>
<tr class="separator:a325e56b14d7ce51ea4ee3cdfe6189490"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a146ce02cc7422b3a3bca07533536450e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a146ce02cc7422b3a3bca07533536450e">operator=</a> (const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;src)</td></tr>
<tr class="memdesc:a146ce02cc7422b3a3bca07533536450e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overwrites <code>*this</code> with a copy of <code>src</code>.  <a href="classflow_1_1log_1_1Component.html#a146ce02cc7422b3a3bca07533536450e">More...</a><br /></td></tr>
<tr class="separator:a146ce02cc7422b3a3bca07533536450e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0587562779694526b8dd1e8f7012494"><td class="memTemplParams" colspan="2">template&lt;typename Payload &gt; </td></tr>
<tr class="memitem:ae0587562779694526b8dd1e8f7012494"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#ae0587562779694526b8dd1e8f7012494">operator=</a> (Payload new_payload)</td></tr>
<tr class="memdesc:ae0587562779694526b8dd1e8f7012494"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code>operator=(<a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>&lt;Payload&gt;(new_payload))</code> modulo possibly minor perf differences.  <a href="classflow_1_1log_1_1Component.html#ae0587562779694526b8dd1e8f7012494">More...</a><br /></td></tr>
<tr class="separator:ae0587562779694526b8dd1e8f7012494"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78dc45840c6fb12bd53784f7ea277ab4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a78dc45840c6fb12bd53784f7ea277ab4">operator=</a> (<a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&amp;src_moved)</td></tr>
<tr class="memdesc:a78dc45840c6fb12bd53784f7ea277ab4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Makes <code>*this</code> equal to <code>src_moved</code>.  <a href="classflow_1_1log_1_1Component.html#a78dc45840c6fb12bd53784f7ea277ab4">More...</a><br /></td></tr>
<tr class="separator:a78dc45840c6fb12bd53784f7ea277ab4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5af2f66731c407bd519a873706bd04c4"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4">empty</a> () const</td></tr>
<tr class="memdesc:a5af2f66731c407bd519a873706bd04c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>true</code> if <code>*this</code> is as if default-constructed (a null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>); <code>false</code> if as if constructed via the 1-arg constructor (a non-null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>).  <a href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4">More...</a><br /></td></tr>
<tr class="separator:a5af2f66731c407bd519a873706bd04c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a656f5868adbd8c58c493981fe1764699"><td class="memTemplParams" colspan="2">template&lt;typename Payload &gt; </td></tr>
<tr class="memitem:a656f5868adbd8c58c493981fe1764699"><td class="memTemplItemLeft" align="right" valign="top">Payload&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a656f5868adbd8c58c493981fe1764699">payload</a> () const</td></tr>
<tr class="memdesc:a656f5868adbd8c58c493981fe1764699"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns reference to immutable payload stored in <code>*this</code>; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>.  <a href="classflow_1_1log_1_1Component.html#a656f5868adbd8c58c493981fe1764699">More...</a><br /></td></tr>
<tr class="separator:a656f5868adbd8c58c493981fe1764699"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ff8ff4d75add447b3e10ded5430833d"><td class="memItemLeft" align="right" valign="top">const std::type_info &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a3ff8ff4d75add447b3e10ded5430833d">payload_type</a> () const</td></tr>
<tr class="memdesc:a3ff8ff4d75add447b3e10ded5430833d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>typeid(Payload)</code>, where <code>Payload</code> was the template param used when calling the originating one-arg constructor or equivalent; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>.  <a href="classflow_1_1log_1_1Component.html#a3ff8ff4d75add447b3e10ded5430833d">More...</a><br /></td></tr>
<tr class="separator:a3ff8ff4d75add447b3e10ded5430833d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a899a7d2b0c5daa8e4d666d431b9bf48e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80">enum_raw_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classflow_1_1log_1_1Component.html#a899a7d2b0c5daa8e4d666d431b9bf48e">payload_enum_raw_value</a> () const</td></tr>
<tr class="memdesc:a899a7d2b0c5daa8e4d666d431b9bf48e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the numeric value of the <code>enum</code> payload stored by this <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>, originating in the one-arg constructor; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>.  <a href="classflow_1_1log_1_1Component.html#a899a7d2b0c5daa8e4d666d431b9bf48e">More...</a><br /></td></tr>
<tr class="separator:a899a7d2b0c5daa8e4d666d431b9bf48e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p >A light-weight class, each object storing a <em>component</em> payload encoding an <code>enum</code> value from <code>enum</code> type of user's choice, and a light-weight ID of that <code>enum</code> type itself. </p>
<p >A <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> is supplied by the user, at every logging call site, along with the message. <a class="el" href="classflow_1_1log_1_1Log__context.html" title="Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...">Log_context</a> (or <a class="el" href="log_8hpp.html#ae4b5d4fdd2eb052615620879dd74af95" title="For the rest of the block within which this macro is instantiated, causes all FLOW_LOG_....">FLOW_LOG_SET_CONTEXT()</a> in relatively rare scenarios) makes this easier, so typically user need not literally type out a component at every logging call site, meaning there is a "context" that already stores it and need not be re-specified.</p>
<p >A <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> can be either empty, as when default-constructed, indicated by <a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> returning <code>true</code>; or non-empty, in which case it actually stores something interesting. In the latter case, construct it with the templated one-arg constructor. The template arg <code>Payload</code> must, always, be user's own <code>enum class</code>. In order to have this <code>Payload</code> interpreted correctly, one can (and usually should) use the <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a> facility which is used by out-of-the-box <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> implementations including <a class="el" href="classflow_1_1log_1_1Simple__ostream__logger.html" title="An implementation of Logger that logs messages to the given ostreams (e.g., cout or an ofstream for a...">Simple_ostream_logger</a> (useful for console output) and <a class="el" href="classflow_1_1log_1_1Async__file__logger.html" title="An implementation of Logger that logs messages to a given file-system path but never blocks any loggi...">Async_file_logger</a> (for heavy-duty file logging, including rotation support). However, this is technically optional: one can implement their own <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> which might not use the <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a> facility and thus deal with the meaning of <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> in some completely different way. I'd start with an existing <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> implementation however; and if writing one's own <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a>, then still have it use <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a>, unless that system is somehow insufficient or inappropriate.</p>
<p >Tip: Arguably the best way to see how to use all this together, just see <a class="el" href="namespaceflow.html#a3938730ab4b89daf13d027a5f620e7ce" title="The flow::log::Component payload enumeration comprising various log components used by Flow&#39;s own int...">flow::Flow_log_component</a> and how Flow's own code (which, itself, logs!) uses the log system. This is discussed in more detail in the class <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a> doc header. Lastly, some clarifying discussion may be found (as of this writing) in the Component::type_info() doc header.</p>
<h3>Thread safety, mutability</h3>
<p >A <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> is immutable as of this writing, except one can trivially overwrite a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> via an assignment operator. The latter write operation is not thread-safe w.r.t. a given <code>*this</code>, though in practice this is unlikely to ever matter. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a8c746035d0eea4a26d0982eabf63b713" name="a8c746035d0eea4a26d0982eabf63b713"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c746035d0eea4a26d0982eabf63b713">&#9670;&nbsp;</a></span>Component() <span class="overload">[1/4]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">flow::log::Component::Component </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> that stores no payload; meaning an unspecified-component <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> that returns <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>. </p>
<p >Every <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> and all other systems must accept a message with such a null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>. However, one can configure a given <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> to ensure such messages not be logged (filtered out via <code>should_log()</code>). Point is, any log call site that supplied a null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> must still work, meaning not cause undefined behavior. </p>

</div>
</div>
<a id="a2dbca7a7e6b6c43c2119db1858c3b29d" name="a2dbca7a7e6b6c43c2119db1858c3b29d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2dbca7a7e6b6c43c2119db1858c3b29d">&#9670;&nbsp;</a></span>Component() <span class="overload">[2/4]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Payload &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">flow::log::Component::Component </td>
          <td>(</td>
          <td class="paramtype">Payload&#160;</td>
          <td class="paramname"><em>payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructs a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> with the given payload of arbitrary type, so long as that type is an <code>enum class : <a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80" title="The type Payload must be enum class Payload : enum_raw_t: an enum type encoded via this integer type.">Component::enum_raw_t</a></code>. </p>
<p >(<a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80" title="The type Payload must be enum class Payload : enum_raw_t: an enum type encoded via this integer type.">enum_raw_t</a> is an unsigned integer type.) The resulting <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> will return <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == false</code>.</p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Payload</td><td>The type of the component value stored inside <code>*this</code>. This is required to be a type satisfying the requirements in the doc header for <a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80" title="The type Payload must be enum class Payload : enum_raw_t: an enum type encoded via this integer type.">enum_raw_t</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>The payload value copied into <code>*this</code> and whenever a <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> itself is copied (or moved). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5edb4c020c9de20e4c1c96c460b624e8" name="a5edb4c020c9de20e4c1c96c460b624e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5edb4c020c9de20e4c1c96c460b624e8">&#9670;&nbsp;</a></span>Component() <span class="overload">[3/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">flow::log::Component::Component </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Copies the source <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> into <code>*this</code>. </p>
<p >This involves a single payload copy (and not even that if <code>src.empty()</code>).</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Object to copy. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a325e56b14d7ce51ea4ee3cdfe6189490" name="a325e56b14d7ce51ea4ee3cdfe6189490"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a325e56b14d7ce51ea4ee3cdfe6189490">&#9670;&nbsp;</a></span>Component() <span class="overload">[4/4]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">flow::log::Component::Component </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>src_moved</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Constructs <code>*this</code> equal to <code>src_moved</code>. </p>
<p >In this implementation it is equivalent to the copy constructor.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_moved</td><td>Object to move. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a5af2f66731c407bd519a873706bd04c4" name="a5af2f66731c407bd519a873706bd04c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5af2f66731c407bd519a873706bd04c4">&#9670;&nbsp;</a></span>empty()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool flow::log::Component::empty </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <code>true</code> if <code>*this</code> is as if default-constructed (a null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>); <code>false</code> if as if constructed via the 1-arg constructor (a non-null <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>). </p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a78dc45840c6fb12bd53784f7ea277ab4" name="a78dc45840c6fb12bd53784f7ea277ab4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78dc45840c6fb12bd53784f7ea277ab4">&#9670;&nbsp;</a></span>operator=() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp; flow::log::Component::operator= </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>src_moved</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Makes <code>*this</code> equal to <code>src_moved</code>. </p>
<p >In this implementation it is equivalent to copy assignment. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src_moved</td><td>Object to move. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>*this</code>. </dd></dl>

</div>
</div>
<a id="a146ce02cc7422b3a3bca07533536450e" name="a146ce02cc7422b3a3bca07533536450e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a146ce02cc7422b3a3bca07533536450e">&#9670;&nbsp;</a></span>operator=() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp; flow::log::Component::operator= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp;&#160;</td>
          <td class="paramname"><em>src</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Overwrites <code>*this</code> with a copy of <code>src</code>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">src</td><td>Object to copy. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>*this</code>. </dd></dl>

</div>
</div>
<a id="ae0587562779694526b8dd1e8f7012494" name="ae0587562779694526b8dd1e8f7012494"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0587562779694526b8dd1e8f7012494">&#9670;&nbsp;</a></span>operator=() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Payload &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1log_1_1Component.html">Component</a> &amp; flow::log::Component::operator= </td>
          <td>(</td>
          <td class="paramtype">Payload&#160;</td>
          <td class="paramname"><em>new_payload</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Equivalent to <code>operator=(<a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>&lt;Payload&gt;(new_payload))</code> modulo possibly minor perf differences. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">new_payload</td><td>See non-default constructor. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>*this</code>. </dd></dl>

</div>
</div>
<a id="a656f5868adbd8c58c493981fe1764699" name="a656f5868adbd8c58c493981fe1764699"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a656f5868adbd8c58c493981fe1764699">&#9670;&nbsp;</a></span>payload()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Payload &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Payload flow::log::Component::payload</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns reference to immutable payload stored in <code>*this</code>; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>. </p>
<dl class="tparams"><dt>Template Parameters</dt><dd>
  <table class="tparams">
    <tr><td class="paramname">Payload</td><td>See one-arg ctor doc header. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<a id="a899a7d2b0c5daa8e4d666d431b9bf48e" name="a899a7d2b0c5daa8e4d666d431b9bf48e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a899a7d2b0c5daa8e4d666d431b9bf48e">&#9670;&nbsp;</a></span>payload_enum_raw_value()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classflow_1_1log_1_1Component.html#a287888e2943b312f4febc3e8e130fc80">Component::enum_raw_t</a> flow::log::Component::payload_enum_raw_value </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the numeric value of the <code>enum</code> payload stored by this <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a>, originating in the one-arg constructor; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>. </p>
<dl class="section return"><dt>Returns</dt><dd>See above. Specifically that's: <code>static_cast&lt;enum_raw_t&gt;(payload)</code>, where <code>payload</code> was passed to originating 1-arg ctor. </dd></dl>

</div>
</div>
<a id="a3ff8ff4d75add447b3e10ded5430833d" name="a3ff8ff4d75add447b3e10ded5430833d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3ff8ff4d75add447b3e10ded5430833d">&#9670;&nbsp;</a></span>payload_type()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::type_info &amp; flow::log::Component::payload_type </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns <code>typeid(Payload)</code>, where <code>Payload</code> was the template param used when calling the originating one-arg constructor or equivalent; undefined behavior if <code><a class="el" href="classflow_1_1log_1_1Component.html#a5af2f66731c407bd519a873706bd04c4" title="Returns true if *this is as if default-constructed (a null Component); false if as if constructed via...">empty()</a> == true</code>. </p>
<p ><a class="el" href="namespaceflow_1_1log.html" title="Flow module providing logging functionality.">flow::log</a> user that relies fully on an out-of-the-box <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a>, or on a custom <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> that nevertheless fully uses the <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a> facility, is unlikely to need this information. (It is used internally by <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a>.) However, a custom <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> that decided to use an alternative <a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a> mechanism (as opposed to how <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a> and reliant <code><a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a></code>s do) can use this <a class="el" href="classflow_1_1log_1_1Component.html#a3ff8ff4d75add447b3e10ded5430833d" title="Returns typeid(Payload), where Payload was the template param used when calling the originating one-a...">payload_type()</a> method to distinguish between potential source <code>enum</code>s that were passed to the <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> at each given log call site.</p>
<p >For example, consider that Flow itself, for its own logging, uses the <a class="el" href="namespaceflow.html#a3938730ab4b89daf13d027a5f620e7ce" title="The flow::log::Component payload enumeration comprising various log components used by Flow&#39;s own int...">flow::Flow_log_component</a> <code>enum</code> at all log call sites. Imagine you, the user, have decided to generate your own <a class="el" href="namespaceflow_1_1log.html" title="Flow module providing logging functionality.">flow::log</a> messages and always use your own <code>enum class cool_project::Cool_log_component</code> at your own logging call sites. Then, a typical component specification will look like this respectively:</p>
<div class="fragment"><div class="line"><span class="keyword">class </span><a class="code hl_class" href="classflow_1_1net__flow_1_1Node.html">flow::net_flow::Node</a> : <span class="keyword">public</span> <a class="code hl_class" href="classflow_1_1log_1_1Log__context.html">Log_context</a></div>
<div class="line">{</div>
<div class="line">  Node(...) :</div>
<div class="line">    <a class="code hl_class" href="classflow_1_1log_1_1Log__context.html">Log_context</a>(..., <a class="code hl_enumeration" href="namespaceflow.html#a3938730ab4b89daf13d027a5f620e7ce">Flow_log_component</a>::S_NET_FLOW) <span class="comment">// This class will usually use the NET_FLOW component.</span></div>
<div class="line">    ...</div>
<div class="line"> </div>
<div class="line">class cool_project::Cool_class_about_widgets : public <a class="code hl_class" href="classflow_1_1log_1_1Log__context.html">Log_context</a></div>
<div class="line">{</div>
<div class="line">  Cool_class_about_widgets(...) :</div>
<div class="line">    <a class="code hl_class" href="classflow_1_1log_1_1Log__context.html">Log_context</a>(..., Cool_log_component::S_WIDGETRY) <span class="comment">// Ditto for your own code.  Use your own enum.</span></div>
<div class="ttc" id="aclassflow_1_1log_1_1Log__context_html"><div class="ttname"><a href="classflow_1_1log_1_1Log__context.html">flow::log::Log_context</a></div><div class="ttdoc">Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...</div><div class="ttdef"><b>Definition:</b> log.hpp:1610</div></div>
<div class="ttc" id="aclassflow_1_1net__flow_1_1Node_html"><div class="ttname"><a href="classflow_1_1net__flow_1_1Node.html">flow::net_flow::Node</a></div><div class="ttdoc">An object of this class is a single Flow-protocol networking node, in the sense that: (1) it has a di...</div><div class="ttdef"><b>Definition:</b> node.hpp:934</div></div>
<div class="ttc" id="anamespaceflow_html_a3938730ab4b89daf13d027a5f620e7ce"><div class="ttname"><a href="namespaceflow.html#a3938730ab4b89daf13d027a5f620e7ce">flow::Flow_log_component</a></div><div class="ttdeci">Flow_log_component</div><div class="ttdoc">The flow::log::Component payload enumeration comprising various log components used by Flow's own int...</div><div class="ttdef"><b>Definition:</b> common.hpp:638</div></div>
</div><!-- fragment --><p >Now, <code>this-&gt;get_log_component().<a class="el" href="classflow_1_1log_1_1Component.html#a3ff8ff4d75add447b3e10ded5430833d" title="Returns typeid(Payload), where Payload was the template param used when calling the originating one-a...">payload_type()</a></code> will equal that of <code>Flow_log_component</code> and <code>Cool_log_component</code>, respectively, within those 2 classes. In particular, a custom <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> implementation can use <code><a class="el" href="classflow_1_1log_1_1Component.html#a3ff8ff4d75add447b3e10ded5430833d" title="Returns typeid(Payload), where Payload was the template param used when calling the originating one-a...">payload_type()</a></code> to interpret the <code><a class="el" href="classflow_1_1log_1_1Component.html" title="A light-weight class, each object storing a component payload encoding an enum value from enum type o...">Component</a></code>s of values from the 2 entirely disparate <code>enum</code>s in different ways. More in particular, the out-of-the-box <code><a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a></code>s use <code><a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">Config</a></code> to do all of that without your having to worry about it (but your own <a class="el" href="classflow_1_1log_1_1Logger.html" title="Interface that the user should implement, passing the implementing Logger into logging classes (Flow&#39;...">Logger</a> would potentially have to worry about it particularly if not using <a class="el" href="classflow_1_1log_1_1Config.html" title="Class used to configure the filtering and logging behavior of Loggers; its use in your custom Loggers...">log::Config</a>... though we suggest that you should, barring excellent design counter-reasons).</p>
<dl class="section return"><dt>Returns</dt><dd>See above. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>log/<a class="el" href="log_8hpp.html">log.hpp</a></li>
<li>log/<a class="el" href="log_8cpp.html">log.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 28 2025 22:55:32 for Flow by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.4
</small></address>
</body>
</html>
